﻿using log4net;
using System;
using System.Text.RegularExpressions;

namespace Hjt212Parser
{
    public static class StringHelper
    {
        private static readonly ILog Log = LogManager.GetLogger(typeof(StringHelper));

        public static string SubSuffixString(string loginString, int len)
        {
            if (string.IsNullOrEmpty(loginString)) return null;
            var charArray = loginString.ToCharArray();
            Array.Reverse(charArray);
            loginString = Regex.Match(new string(charArray), "[0-9]{" + len + "}").Value;
            charArray = loginString.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }
    }
}
